import { createRouter, createWebHashHistory } from 'vue-router';

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'default',
      redirect: '/basicPage',
      children: [
        {
          path: '/basicPage',
          name: 'basicPage',
          component: () => import('@/views/basicPage/index.vue'),
          children: [],
          meta: {
            title: '基础页面',
          },
        },
        {
          path: '/readOnlyPage',
          name: 'readOnlyPage',
          component: () => import('@/views/readOnlyPage/index.vue'),
          children: [],
          meta: {
            title: '只读页面',
          },
        },
        {
          path: '/multiLevelTablePage',
          name: 'multiLevelTablePage',
          component: () => import('@/views/multiLevelTablePage/index.vue'),
          children: [],
          meta: {
            title: '多级表头页面',
          },
        },
        {
          path: '/writeTablePage',
          name: 'writeTablePage',
          component: () => import('@/views/writeTablePage/index.vue'),
          children: [],
          meta: {
            title: '编辑表格页面',
          },
        },
      ],
      meta: {
        title: '表单页面',
      },
    },
    {
      path: '/calendarManage',
      name: 'calendarManage',
      component: () => import('@/views/calendarManage/index.vue'),
      meta: {
        title: '管理日历',
      },
    },
    {
      path: '/effectsPage',
      name: 'effectsPage',
      meta: {
        title: '特效页面',
      },
      children: [
        {
          path: '/pageLoading',
          name: 'pageLoading',
          component: () => import('@/views/effectsPage/pageLoading/index.vue'),
          meta: {
            title: '页面加载',
          },
        },
        {
          path: '/codeRain',
          name: 'codeRain',
          component: () => import('@/views/effectsPage/codeRain/index.vue'),
          meta: {
            title: '代码雨',
          },
        },
      ],
    },
  ],
});

export default router;
